"""第七章 文件操作"""

data=[
    ["姓名","年龄","性别"],
    ["Tom","20","male"],
    ["Jack","21","male"],
    ["Lucy","19","female"]
]
#写入csv文件
import csv
with open("test4.csv","a",newline="",encoding="utf-8") as f:
    #单行写入
    writer=csv.writer(f)
    for row in data:
        writer.writerow(row)

print(f"{'我的学习笔记':-^12}")